import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.regex.Pattern;
import java.util.stream.Collectors;

public class Main {

    public static void main(String[] args) {
        // List<String> list = new ArrayList<>();
        // list.add("1");
        // list.add("2");
        //
        // List<Integer> integerList = list.stream()
        //         .filter(myString -> myString.equals("2"))
        //         .mapToInt(number -> Integer.valueOf(number))
        //         .boxed()
        //         .collect(Collectors.toList());
        // integerList.forEach(number -> System.out.println(number));

        List<Integer> numberList = new ArrayList<>();
        numberList.add(1);
        numberList.add(1);
        numberList.add(2);
        List<String> collect = numberList.stream()
                .filter(myString -> myString.equals(2))
                .map(integer -> String.valueOf(integer))
                .collect(Collectors.toList());
        collect.forEach(myString -> System.out.println(myString.getClass()));
        Integer integer = numberList.stream().filter(myString -> myString.equals(2)).findAny().get();
        System.out.println(integer);

        System.out.println(LocalDateTime.parse("2019-07-25T21:00:04").toLocalDate());

        // String str = "17689229939";
        // String pattern = "^((13[0-9])|(14[5|7])|(15([0-9]))|(16[0-9])|(17[0-9])|(18[0-9])|(19[0-9]))\\d{8}$";
        //
        // Pattern r = Pattern.compile(pattern);
        // Matcher m = r.matcher(str);
        // System.out.println(m.matches());

        System.out.println(Pattern.matches("^[0-9a-zA-Z]{1,20}$", ""));
        System.out.println(Pattern.matches("^[\\u4e00-\\u9fa5_a-zA-Z0-9_]{1,20}$", "程军打的算__"));
        System.out.println(UUID.randomUUID().toString().length());
        System.out.println(UUID.randomUUID().toString().length());
        System.out.println(UUID.randomUUID().toString().length());
        System.out.println(UUID.randomUUID().toString());
        System.out.println(UUID.randomUUID().toString());
        System.out.println(UUID.randomUUID().toString());


    }



}
